//
//  UserAttentionHouseTypeView.m
//  YIJU2.0HD
//
//  Created by URANUS on 16/5/16.
//  Copyright © 2016年 Mr.X. All rights reserved.
//

#import "UserAttentionHouseTypeView.h"
#import "Macro.h"
#import "Masonry.h"

#define kCellBackGroundColor [UIColor colorWithRed:0.867 green:0.875 blue:0.929 alpha:1.000]

#define kCellRowHeight 100

@interface UserAttentionHouseTypeView ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong)UITableView *houseTypeTable;

@end

static NSString *TableSampleIdentifier = @"cell";

@implementation UserAttentionHouseTypeView

- (instancetype)init {
    if (self == [super init]) {
        [self setUpContaints];
    }
    return self;
}

#pragma mark - TableView delegate dataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
                             TableSampleIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableSampleIdentifier];
    }
   cell.textLabel.text = @"123345678987998098";
    cell.imageView.image = [UIImage imageNamed:@"BusinessTaIk"];
    cell.backgroundColor = [UIColor clearColor];
    return cell;

}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return kCellRowHeight;
}

- (void)setUpContaints {
    [self.houseTypeTable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(70);
        make.left.equalTo(self.mas_left);
        make.width.equalTo(self.mas_width);
        make.bottom.equalTo(self.mas_bottom);
    }];
}

#pragma mark - getter
- (UITableView *)houseTypeTable {
    if (_houseTypeTable == nil) {
        _houseTypeTable = [[UITableView alloc]init];
        _houseTypeTable.backgroundColor = [UIColor clearColor];
        _houseTypeTable.scrollEnabled = NO;
        _houseTypeTable.dataSource = self;
        _houseTypeTable.delegate = self;
        _houseTypeTable.separatorStyle = UITableViewCellSeparatorStyleNone;
        [self addSubview:_houseTypeTable];
    }
    return _houseTypeTable;
}

@end
